<script type="text/javascript">
    var personDefaultPassowrd = {
        pdialog: $.pdialog.getCurrent(),
        save: function (form) {
            var oldPass = $('#oldReal', this.pdialog).val();
            if (oldPass == '') {
                alertMsg.warn('初始密码不能为空');
                return false;
            }
            var newPass = $('#newReal', this.pdialog).val();
            if (newPass == ''){
                alertMsg.warn('新密码不能为空');
                return false;
            }
            if (oldPass == newPass) {
                alertMsg.warn('新密码不得为初始密码');
                return false;
            }
            var newPass2 = $('#newReal2', this.pdialog).val();
            if (newPass != '' && newPass != newPass2) {
                alertMsg.warn('新密码与重复密码不一致');
                return false;
            }
            $('[name="oldPassword"]', this.pdialog).val($.md5(oldPass));
            $('[name="newPassword"]', this.pdialog).val($.md5(newPass));
            return validateCallback(form, dialogAjaxDone);
        }
    };
</script>
<form method="post" action="admin/person/savePassword" class="pageForm"
      onsubmit="return personDefaultPassowrd.save(this);">
    <div class="pageFormContent nowrap" layoutH="56">
        <input type="hidden" name="model.id" value="${model.id}"/>
        <table class="dialogTable">
            <tr>
                <td>初始密码</td>
                <td>
                    <input id="oldReal" type="password" placeholder="初始密码">
                    <input name="oldPassword" type="hidden">
                </td>
            </tr>
            <tr>
                <td>新密码</td>
                <td>
                    <input id="newReal" type="password" placeholder="新密码">
                    <input name="newPassword" type="hidden">
                </td>
            </tr>
            <tr>
                <td>重复密码</td>
                <td>
                    <input id="newReal2" type="password" placeholder="重复密码">
                </td>
            </tr>
            <tr>
                <td colspan="2">
                    您当前使用的是初始密码，请修改后方能使用后台
                </td>
            </tr>
        </table>
    </div>
    <div class="formBar">
        <ul>
            <li>
                <div class="buttonActive">
                    <div class="buttonContent">
                        <button type="submit">保存</button>
                    </div>
                </div>
            </li>
        </ul>
    </div>
</form>